<template>
 <div>
     <button @click="temp=1">热搜榜</button>
  <button @click="temp=2">娱乐</button>
  <button @click="temp=3">体育</button>
  <button @click="getul">获取ul</button>
  <!-- 给标签一个ref属性，$refs对象上储存的是对应的真实Dom -->
    <ul v-show='temp == 1' ref="news">
        <li>彭彭，许凯《密室逃脱》上蹿下跳...</li>
        <li>沉香如屑悲惨进行时...</li>
        <li>王传君结婚...</li>
    </ul>
     <ul v-show='temp == 2'>
        <li>jhdsadgjz</li>
        <li>fsdfdfz</li>
        <li>xzczds</li>
    </ul>
     <ul v-show='temp == 3'>
        <li>东京奥运...</li>
        <li>北京奥运...</li>
        <li>苏炳添亚洲飞人...</li>
    </ul>
 </div>

  
</template>

<script>
export default {
    name:'News',
    data(){
       return{
        temp:null
       }
    },
    methods:{
        getul(){
            console.log(this.$refs.news);
        }
    }
}
</script>

<style>

</style>